#!/usr/bin/env bash

NSname=$1
msdelay=$2
inner_ifname="veth"

ip netns exec $NSname \
    tc qdisc change dev ${inner_ifname} root netem delay ${msdelay}ms || exit 1

#  #[delay] [duplicate] [corrupt]
#  ip netns exec $NSname \
#      tc qdisc change dev ${inner_ifname} root netem \
#          delay $[100 + $RANDOM % 500] 100ms $[RANDOM % 100]% \
#          duplicate 0.$[1 + $RANDOM % 9]% \
#          corrupt 0.$[1 + $RANDOM % 9]% \
#          || exit 1
